package com.softoa.serviceImp;

import com.softoa.mapper.InformMapper;
import com.softoa.pojo.Inform;
import com.softoa.service.IInformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.beans.Transient;
import java.util.List;

@Service
public class InformServiceImp  implements IInformService {
    @Autowired
    InformMapper informMapper;

    public List<Inform> perlist(Inform inform){
        return informMapper.perlist(inform);
    }
    public boolean informPre(Inform inform){
        int n=informMapper.informPre(inform);
        if (n>0)
            return true;
        return false;
    }
    public boolean informInsert(Inform inform) {
        int n=informMapper.informInsert(inform);
        if (n>0)
                return true;
        return false;
    }
    public boolean informDelete(Inform informId){
        int n=informMapper.informDelete(informId);
        System.out.println(informId);
        if(n>0)
            return true;
        return false;
    }
    public int update(Inform inform){

        return informMapper.update(inform);
    }
    public int upstate(Inform inform){
        return informMapper.upstate(inform);
    }
    public List<Inform> informList(Inform inform) {

        return informMapper.informList(inform);
    }

    public int usertest(Inform inform){
        int n=informMapper.usertest(inform);
        String N = Integer.toString(n);
        if(N.matches(".*经理")){
            return 1;
        }
        else{
            return 0;
        }
    }

}
